package com.sky.service.impl;

import com.sky.entity.TimeAmouet;
import com.sky.mapper.ReportMapper;
import com.sky.service.ReportService;
import com.sky.vo.OrderReportByDayVo;
import com.sky.vo.TurnoverReportVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class ReportServiceImpl implements ReportService {

    @Autowired // 统计业务层
    private ReportMapper reportMapper;

    /**
     * 营业额统计
     * @param begin
     * @param end
     * @return
     */
    @Override
    public TurnoverReportVO turnoverStatistics(LocalDate begin, LocalDate end) {

        // 业务层
        /*List<TimeAmouet> timeAmouetList = reportMapper.turnoverStatistics(begin,end);


        if(timeAmouetList != null){
            for (TimeAmouet timeAmouet : timeAmouetList) {
                System.out.println(timeAmouet.getAmount());
            }
        }
        */

        List<TimeAmouet> timeAmouetList = reportMapper.turnoverStatistics(begin, end);

        for (TimeAmouet timeAmouet : timeAmouetList) {

        }

        return null;
    }
}
